Add support for more selective pruning
authorColin Walters <walters@verbum.org>
Thu, 1 Dec 2016 14:28:24 +0000 (09:28 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 19 Jan 2017 16:28:00 +0000 (16:28 +0000)
commit5c940987e768523ef1411b65bcaad09fba6befef
tree39c622549baab6268bf844fe7238bd0add47209c
parent9d94fc40c80ab01b3f96d37dced970a07e8323af
Add support for more selective pruning

There are use cases for having a single repo with branches
with different lifecycles; a simple example of what I was
trying to do in CentOS Atomic Host work is have "stable"
and "devel" branches, were we want to prune devel, but
retain *all* of stable.

This patch is split into two parts - first we add a low level "delete all
objects not in this set" API, and change the current prune API
to use this.

Next, we move more logic into the "ostree prune" command. This paves the way for
demonstrating how more sophisticated algorithms/logic could be developed outside
of the ostree core.

Also, the --keep-younger-than logic already lived in the commandline, so it
makes sense to keep extending it there.

Closes: https://github.com/ostreedev/ostree/issues/604
Closes: #646
Approved by: jlebon
apidoc/ostree-sections.txt
src/libostree/libostree.sym
src/libostree/ostree-repo-prune.c
src/libostree/ostree-repo.h
src/ostree/ot-builtin-prune.c
tests/test-prune.sh